package com.panshi.util;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.panshi.entity.AppUserT;
import com.panshi.service.impl.AppUserTServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UserLoginUtils {

    @Autowired
    private AppUserTServiceImpl appUserTService;


    //验证邮箱登录是否成功
    public AppUserT userphone(String userTelephone,String userPassword){
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("user_telephone",userTelephone);
        wrapper.eq("user_password",userPassword);
        return appUserTService.getOne(wrapper);
    }

    //验证邮箱登录是否成功
    public AppUserT useremail(String userEmail,String userPassword){
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("user_email",userEmail);
        wrapper.eq("user_password",userPassword);
        return appUserTService.getOne(wrapper);
    }
}
